<?php
	include_once '../inc/config.inc.php';
	include_once '../inc/mysql.inc.php';
	include_once '../inc/tool.inc.php';
	if(isset($_POST['submit']))
	{
		$link=connect();
		$check_flag='add';
		//验证填写信息
		include 'inc/check_member_manager.inc.php';
		$query="insert into member
(username,pwd,truename,qq,email,regtime,ip)
values
(
'{$_POST['username']}',md5('{$_POST['pwd']}'),'{$_POST['truename']}',
{$_POST['qq']},'{$_POST['email']}',NOW(),'{$_SERVER["REMOTE_ADDR"]}')";
		execute($link,$query);
		if(mysqli_affected_rows($link)==1)
		{
			skip('member_manager.php','ok','恭喜你，添加成功！');
		}else
		{
			skip('member_manager.php','error','对不起，插入数据失败,请重试！');
		}
		exit();

	}
	$template['title']='添加成员页';
	$template['keyword']='成员管理页';
	$template['css']=array('style/public.css');
?>
<?php include 'inc/header.inc.php';  ?>
<div id="main">
	<div class="title" style="margin-bootom:20px;">添加成员</div>
	<form method="POST">
		<table class="au">
				<tr>
					<td>用户名</td>
					<td><input name="username" type="text" /></td>
					<td>
						不得为空，最大不得超过200个字符
					</td>
				</tr>
				<tr>
					<td>密码</td>
					<td><input name="pwd" type="password" /></td>
					<td>
						填写中/英文名称
					</td>
				</tr>
				<tr>
					<td>成员头像</td>
					<td><input name="photo" type="text" /></td>
					<td>
						可以输入单精度数字
					</td>
				</tr>
				<tr>
					<td>真实名字</td>
					<td><input name="truename" type="text" /></td>
					<td>
						不得为空
					</td>
				</tr>
				<tr>
					<td>qq</td>
					<td><input name="qq" type="text" /></td>
					<td>
						不得为空
					</td>
				</tr>
				<tr>
					<td>邮箱</td>
					<td><input name="email" type="text" /></td>
					<td>
						不得为空
					</td>
				</tr>
				<tr>
					<td>注册时间</td>
					<td><input name="regtime" type="text" /></td>
					<td>
						不得为空
					</td>
				</tr>
				<tr>
					<td>ip地址</td>
					<td><input name="ip" type="text" /></td>
					<td>
						不得为空
					</td>
				</tr>
			</table>
			<?php /*鼠标移动变成手型*/ ?>
			<input style="cursor:pointer;" class="btn" type="submit" name="submit" value="添加" />
	</form>
</div>
<?php include 'inc/footer.inc.php'; ?>